import http from '@/utils/http/axios'
import {ContentTypeEnum} from '@/enums/httpEnum'

enum Api {
    userStrategyList = '/userStrategy/list',
    userStrategyDelete = '/userStrategy/delete',
    userStrategyCreate = '/userStrategy/create',
    userStrategyUpdate = '/userStrategy/update',
}

/**
 * @description: 更新用户策略
 */
export function userStrategyUpdate(params: any) {
    return http.request({
        url: Api.userStrategyUpdate,
        method: 'POST',
        params,
    },{
        isParseToJson: true,
        isTransformRequestResult: false,
        isShowMessage: true,
        successMessageText: '修改成功',
        errorMessageText: '修改失败'
    })
}

/**
 * @description: 添加用户策略
 */
export function userStrategyCreate(params: any) {
    return http.request({
        url: Api.userStrategyCreate,
        method: 'POST',
        params,
    },{
        isParseToJson: true,
        isTransformRequestResult: false,
        isShowMessage: true,
        successMessageText: '添加成功',
        errorMessageText: '添加失败'
    })
}

/**
 * @description: 删除用户策略
 */
export function userStrategyDelete(params: any,option: any) {
    return http.request({
        url: Api.userStrategyDelete,
        method: 'POST',
        params,
    },{
        ...option,
        isTransformRequestResult: false,
        successMessageText: '删除成功',
        errorMessageText: '删除失败'
    })
}

/**
 * @description: 用户策略列表
 */
export function userStrategyList(params: any) {
    return http.request({
        url: Api.userStrategyList,
        method: 'GET',
        params,
    },{
        isTransformRequestResult: false
    })
}
